package com.lap.framework.tools;

import java.util.Collection;
import java.util.stream.Collectors;
import lombok.experimental.UtilityClass;

@UtilityClass
public class CollectionUtil {

  public static String sortAndJoin(Collection<Integer> list) {
    if (list == null || list.isEmpty()) {
      return "";
    }
    return list.stream().sorted().map(String::valueOf).collect(Collectors.joining(","));
  }
}
